package linwen.wang.controller;

import linwen.wang.commom.ReturnVO;
import linwen.wang.pojo.User;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.validation.constraints.NotNull;

/**
 * @ClassName UserController
 * @Description TODO
 * @Author zero
 * @DATE 2023/8/2 8:16 AM
 * @Version 1.0
 */
@RestController
@RequestMapping("/user")
@Slf4j
@Validated
@RequiredArgsConstructor
public class UserController {

    @PostMapping
    public @NotNull ReturnVO addUser(@RequestBody @Validated User user) {
        log.info("params user=={}",user);
        return ReturnVO.buildReturnVO(user);
    }

}
